local skynet = require "skynet"

local tablelogic = {}
tablelogic.cardData = 
{
    0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,       --方 3-2 
    0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,       --梅             
    0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,       --红         
    0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,       --黑 
    0x5E,0x5F,
    0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,       --方 3-2 
    0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,       --梅             
    0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,       --红         
    0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,       --黑
    0x5E,0x5F,
}

function tablelogic:InitChair(num)
    --print('num is '..num)
	for i=0,4 do
 		TableChair[i] = i
 	end
end

function tablelogic:Init()
    for i = 1, CONST.PAI_TOTAL do 
        self.table_RepertoryCard[i] = table_mjCardData[i]
    end
end

local function randCardLocal(card)
    local tab_RandCard = {}
    local len = #card
    math.randomseed(tostring(os.time()):reverse():sub(1, 7))
    for i = 1, len do
        local r = math.random(1, len - i + 1)
        tab_RandCard[i], card[r] = card[r], card[len - i + 1]
    end
    return tab_RandCard
end

function tablelogic:GetChair(chairIndex)
	return self.chairAct[self.chairIndex[chairIndex]]
end



return tablelogic

